home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-1.iso / Files / Educ / Teacher / Multimedia tester-prese.sit / Multimedia tester_presenter / Multimedia tester_presenter / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1993-11-17  |  12.0 KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>5</cardCount>
  7.     <cardID>4376</cardID>
  8.     <listID>6003</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>-- THE ROUTINES USED IN THIS SCRIPT:-- GetReady,GQ,Initialize,AnswerIt,GetFonts,FixIt,DoItTo,Options,-- SomethingsWrong,GetATest,GetTheInfo,GetName,ChangeFont,ChangeSize-- DoMovie,DoPicture,DoSound,DoVideodisc,VideoCheck,TheRoutine-- XCMD'S USED BY THIS SCRIPT:-- GetReady2 XCMD  by Jim Nauta-- Form: GetReady2 (text container,starting line number)-- It's used to determine starting line numbers for questions in a test-- not useful outside of this test-- Jumble XCMD  by Jim Nauta-- Form: Jumble (text container,boolean value)-- Used to encode any text with a substitution code.-- pass True to encode and false to decode-- DO NOT pass more than 90 lines of text at a time!-- should work with any text file.  may be fun to play with.------------------------------------------------------------------------on domenu what1if what1 is "Quit HyperCard"  and the short name of this card is "Q" thenplay "boing"answer "Are you sure you want to" & return &  "quit without finishing?" with "OK" or "Cancel"if it is "Cancel" then  exit to HyperCardelsecleanupgo nextexit to HyperCardend ifend ifpass domenuend domenu-------------------------------------------------------------------------- THIS ROUTINE INITIALIZES A NEW TEST AND USES THE GETREADY2 XCMD.-- GLOBAL VARIABLES:--requires XCMD GetReady2on getReadyglobal qStart,totalQuestions,theTest,theLocOfTestset cursor to watchput "Preparing test..."if there is a stack theLocOfTest & "sounds" then start using stack theLocOfTest & "sounds"Initialize-- (since text is converted into a Pascal array before being processed-- a 90 line limit at one time is used to save memory.)-- qStart is the starting line number for each question within the test fileput the number of lines of thetest div 90 into FullLoopsput the number of lines of thetest mod 90 into LeftOverrepeat with x = 1 to FullLoopsput 90 * x into chunkput line chunk - 89 to chunk of thetest into SendPartGetReady2 SendPart,chunk - 89put the result after QStartend repeatif leftover > 0 thenput  FullLoops * 90 + 1  into chunkput line chunk to chunk + LeftOver of thetest into SendPartGetReady2 SendPart,FullLoops * 90 + 1put the result after QStartend ifput 1 into item 1 of qStart -- line number of first question in testdelete last item of qStart -- points to end of the test so get rid of itput the number of items of qStart into totalQuestionsif totalQuestions <= 1 then SomethingsWrongput ""hide msgend getReadyon Initializeglobal qStart,scoredQuestions,QuestionsMissed,textofQuestionsMissed,correctput "" into qStartput "" into scoredQuestionsput "" into QuestionsMissedput "" into textOfQuestionsMissedput 0 into correctend Initialize-------------------------------------------------------------------------- this routine gets the next question and checks for the end of test.-- it also displays any picture, movie, or sound that goes along with a question.-- uses handlers DoMovie, DoPicture, DoSound, DoVideodisc  (in this script)on gqglobal theTest,theAnswer,QuestionNumber,qStart,dontRandomizeif the number of items of qStart= 0 then  -- the test is overset lockscreen to truego cd "score"exit gqend ifset lockscreen to trueif dontRandomize thenput item 1 of qStart into nextQuestiondelete item 1 of qStartelseput random(the number of items of qStart)  into itemToDeleteput item itemToDelete  of qStart into  nextQuestiondelete  item itemToDelete of qStartend ifput nextquestion into theCount -- error checking variable for length of questionrepeat until item 1 of line nextQuestion of  theTest = "answer"put line nextQuestion of  theTest after bg field "theText" of cd "Q"put return after bg field "theText" of cd "Q"if nextQuestion - theCount > 25 then SomethingsWrongput 1 + nextQuestion into nextQuestionset cursor to busy  -- mainly for slower machinesend repeatput nextQuestion into xset lockscreen to false  -- display question before playing sounds or showing movies.repeat  -- now get the answer and multimedia itemsif item 1 of line x of theTest = "x" then -- the question's overexit repeatend ifif item 1 of line x of theTest = "answer" thenput item 2 of line x of theTest into theAnswerput item 3 of line x of theTest into QuestionNumberif theAnswer = "" then set the name of cd button id 2 of cd 2 to "Continue"else set the name of cd button id 2 of cd 2 to "Answer Question"end ifif item 1 of line x of theTest = "movie" then DoMovie (item 2 of line x of theTest)if item 1 of line x of theTest = "picture" then DoPicture (item 2 of line x of theTest)if item 1 of line x of theTest = "sound" then DoSound (item 2 of line x of theTest)if item 1 of line x of theTest = "videodisc" then DoVideoDisc (item 2 to 3 of line x of theTest)put 1 + x into xend repeatend gq------------------------------------------------------------------------on AnswerItglobal correct,QuestionsMissed,textOfQuestionsMissed,scoredQuestions,theAnswer,QuestionNumber,noFdbkif theAnswer = "" then exit AnswerIt  -- if no answer on test, don't score it.myDialog 996  -- a quickie. If you want to move it use ResEdit. sorry.put the result into anAnswerif anAnswer is "" then exit to hypercardput 1 + scoredQuestions into scoredQuestions -- need to keep value somewhereif anAnswer = theAnswer thenif not nofdbk then  answer "Correct!"put 1 + correct into correct -- need to keep valueelseif not nofdbk then answer "Sorry."put "," & QuestionNumber after QuestionsMissed --put bg field "theText" of cd Q  after textOfQuestionsMissedput return after textOfQuestionsMissedend ifend AnswerIt-- ------------------------------------------------------------------------on keydown whichend keydownon commandkeydown whatif what = "Q" then domenu "Quit HyperCard"end commandkeydownon arrowkey directionend arrowkey------------------------------------------------------------------------on GetFontsglobal TheFonts,TheSizesput "10,12,14,18" into TheSizesput "Chicago,Courier,Geneva,Helvetica,Times" into theFontsend GetFonts-------------------------------------------------------------------------- this unscrambles a user-selected test before testing begins using the Jumble XCMD-- the XCMD works on 90 line chunks of text at a time-- do not send more than 90 lines of text at a time! (or you will crash)-- requires function TheRoutine and XCMD Jumble-- Boy is this fast compared to HyperTalk!function fixit aTestput "Unscrambling Test..."set cursor to watchput "false" into BoolValput TheRoutine (BoolVal,aTest) into aNewTestdelete char 1 to 3 of aNewTestreturn aNewTestset cursor to handend fixit------------------------------------------------------------------------function TheRoutine BV,theTest-- requires XCMD Jumble-- scrambles or unscrambles a test based on BV (true or false)put the number of lines of thetest div 90 into FullLoopsput the number of lines of thetest mod 90 into LeftOverrepeat with x = 1 to FullLoopsput 90 * x into chunkput line chunk - 89 to chunk of thetest into SendPartjumble SendPart, BVput the result after TheChangedTestend repeatif leftover > 0 thenput  FullLoops * 90 + 1  into chunkput line chunk  to chunk + LeftOver of thetest into SendPartjumble SendPart, BVput the result after TheChangedTestend ifreturn theChangedTestend theRoutine------------------------------------------------------------------------on DoItTo fileName-- reads a test from disk and sends it to XCMD to be-- scrambled/unscrambled and then writes it back to disk-- make sure text file is unlocked or this won't work-- requires function TheRoutine and XCMD Jumbleput "" into theTestopen file filenamerepeatread from file filename for 16384if it is empty then exit repeatput it after theTestend repeatclose file filenameif char 1 to 3 of theTest = "###"  then -- it's scrambledput "false" into boolvalput "Unscrambling..."else -- it's not scrambledput "true" into boolvalput "Scrambling..."end ifset cursor to watchput TheRoutine (BoolVal,theTest) into theNewTestif BoolVal then put "###" before theNewTestelse delete char 1 to 3 of theNewTestopen file filenamewrite theNewTest to file filenameclose file fileNameput ""hide msgend DoItTo------------------------------------------------------------------------on openstackset userlevel to 1Put "Teacher Options..." into menu "Go" with menuMsg Optionsput "Quit HyperCard" into menu "File"set CommandChar of menuItem "Quit HyperCard" of menu "File" to "Q"GetFontshide msgshow cd field "Opening"end openstackon closestackif the freesize of this stack > .05 * the size of this stack thendomenu "Compact Stack"end ifend closestack------------------------------------------------------------------------on Options-- requires handler DoItToask password "password"if it <> cd field "password" of cd "score" then exit optionsanswer "Change Password, Pathname, or Scramble/Unscramble a test?" with "Scramble" or "Password" or "Pathname"if it is "Pathname" thenask "Save Test Results to New Pathname:"if the result is not "Cancel" thenput "Saved To: " & it into cd field "Save Path" of cd "score"end ifexit optionsend ifif it is "Password" thenask password "New Password:"if the result is "Cancel" then exit optionsput it into P1ask password "Verify New Password:"if the result is "Cancel" then exit optionsput it into p2if p1 = p2 thenput p2 into cd field "password" of cd "score"elseanswer "Sorry, passwords don't match."end ifend ifif it is "Scramble" thenanswer file "Select a Test..." of type textif the result is "Cancel" then exit optionsDoItTo itend ifend Options------------------------------------------------------------------------on SomethingsWronghide msgwait while the mouseclick  -- dispose of all extraneous mouseclicksanswer "Having trouble with this test." & return & "Sorry, can't continue."go cd 1exit to HyperCardend SomethingsWrong------------------------------------------------------------------------on GetATestglobal dontPreview-- requires handlers GetTheInfo,GetReady,GetNameanswer file "Select a Test..." of type textif the result is "Cancel" then exit GetATestgetTheInfo itgetReadyGetNameif dontPreview thengo cd 2gqexit GetATestelseanswer "Preview Questions or Start Test?" with "Cancel" or "Preview" or "Start"if it is "Cancel" then exit GetATestif it is "Start" thengo cd 2gqend ifif it is "Preview" thenput "Preparing Preview Session..."set lockscreen to truego cd "review"put ""hide msgend ifend ifend GetATest------------------------------------------------------------------------on getTheInfo fileName-- requires function FixItglobal theTest,testName,theLocOfTest,nofdbk,dontRandomize,dontPreviewput "Loading file..."set cursor to watchput "" into testNamerepeat with x = the number of chars of filename down to 1if char x of filename = ":" then exit repeatput char x of filename before testNameend repeatput char 1 to (the number of chars of filename - the number of chars of testname) of filename into theLocOfTestput "" into theTestopen file filenamerepeatread from file filename for 16384if it is empty then exit repeatput it after TheTestend repeatclose file filenameif char 1 to 3 of theTest = "###" then put fixit(theTest) into theTestif "end." is not in TheTest thenanswer "Can't use that file as a test."put ""hide msgexit to HyperCardend ifif "nofeedback" is in the first line of thetest then put "true" into nofdbkelse put "false" into nofdbkif "norandom" is in the first line of thetest then put "true" into dontRandomizeelse put "false" into dontrandomizeif "nopreview" is in the first line of thetest then put "true" into dontPreviewelse put "false" into dontPreviewif "videodisc" is in the first line of thetes